import axios from "axios";
const GET = (url, params = {}) => {
  return new Promise((reslove, reject) => {
    axios({
      url,
      method: "get",
      params,
    })
      .then(res => {
        reslove(res);
      })
      .catch(err => {
        reject(err);
      });
  });
};
const POST = (url, data = {}) => {
  return new Promise((reslove, reject) => {
    axios({
      url,
      method: "post",
      data: data
    }).then(
      res => {
        reslove(res);
      },
      err => {
        reject(err);
      }
    );
  });
};
export { GET, POST };
